/*
    <Date class, categorize article information according to date>
    Copyright (C) <2011>  <Liao Chen>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
 */
package com.iShare.element;

import java.util.ArrayList;
import java.util.List;


public class Date {
	private int dateId;
	private String dateName;
	private List<Article> articles;
	
	public Date(){
		dateId=0;
		dateName="";
		articles=new ArrayList<Article>();
	}
	
	/*
	 * Set functions
	 */
	public void setDateId(int dateId){
		this.dateId=dateId;
	}
	public void setDateName(String dateName){
		this.dateName=dateName;
	}
	public Boolean addArticle(Article article){
		if(articles.contains(article)){
			return false;
		}else{
			articles.add(article);
			return true;
		}
	}
	
	/*
	 * Get functions
	 */
	public int getDateId(){
		return this.dateId;
	}
	public String getDateName(){
		return this.dateName;
	}
	public List<Article> getArticles(){
		return this.articles;
	}
}
